lib: Add (private) API for checking out commits into a composefs image
authorAlexander Larsson <alexl@redhat.com>
Thu, 9 Jun 2022 15:15:29 +0000 (17:15 +0200)
committerAlexander Larsson <alexl@redhat.com>
Wed, 31 May 2023 08:55:14 +0000 (10:55 +0200)
commite2956e2c08fb3e11e249b540db3a5b760dd04fac
treecc45bc4a2ef5f2b219ef7f4dcad02a3cafded08f
parent9ba98cd8e98ae9501dc1c03ff69920b94f8cd429
lib: Add (private) API for checking out commits into a composefs image

This supports checking out a commit into a tree which is then
converted into a composefs image containing fs-verity digests for all
the regular files, and payloads that are relative to a the
`repo/objects` directory of a bare ostree repo.

Some specal files are always created in the image. This ensures that
various directories (usr, etc, boot, var, sysroot) exists in the
created image, even if they were not in the source commit. These are
needed (as bindmount targets) if you want to boot from the image. In
the non-composefs case these are just created as needed in the checked
out deploydir, but we can't do that here.

This is all controlled by the new ex-integrity config section, which
has the following layout:

```
[ex-integrity]
fsverity=yes/no/maybe
composefs=yes/no/maybe
composefs-apply-sig=yes/no
composefs-add-metadata=yes/no
composefs-keyfiile=/a/path
composefs-certfile=/a/path
```

The `fsverity` key overrides the old `ex-fsverity` section if
specified.  The default for all these is for the new behaviour to be
disabled. Additionally, enabling composefs implies fsverity defaults
to `maybe`, to avoid having to set both.
Makefile-libostree.am
configure.ac
src/libostree/ostree-repo-composefs.c [new file with mode: 0644]
src/libostree/ostree-repo-private.h
src/libostree/ostree-repo-verity.c
src/libostree/ostree-repo.c